<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of TagA
 *
 * @author Jhonny
 */
class TagAComponent {

    private $href;
    private $text;
    private $target;

    public function __construct() {
        $this->target="_self";
    }
    public function getHref() {
        return $this->href;
    }

    public function setHref($href) {
        $this->href = $href;
    }

    public function getText() {
        return $this->text;
    }

    public function setText($text) {
        $this->text = $text;
    }

    public function getTarget() {
        return $this->target;
    }

    public function setTarget($target) {
        $this->target = $target;
    }


    public function toString() {
        $value = '    ';
        if($this->getHref()!=null){
            $value .= '<A href="'.$this->getHref().'">';
            $value.= $this->getText();
            $value.='</A>
                ';
        }
        return $value;
    }
    public function toStringComponent($component) {
        $value = '';
        if($this->getSource()!=null){
            $value = '<A href="'.$this->getHref().'"';
            $value.=' target="'.$this->getTarget().'"';
            $value.='  >';
            $value.=$component->toString();
            $value.='</A>';
        }
        return $value;
    }
}
?>
